#! /usr/bin/env python
# -*- coding: utf-8 -*-

"""
yield测试
"""

def y_test(x):
    for i in range(x):
        yield i
        print(i)


def main():
    # y_test(3)
    c = y_test(3)
    print(next(c))
    print(next(c))
    print(next(c))
    print(next(c))

if __name__ == '__main__':
    main()